package com.karson.service.service;

import lombok.Data;
import org.springframework.stereotype.Service;

/**
 * @author ZKS
 */
@Service
public class SqlServiceFactory {

    public String getOrderSql(Integer orderType) {
        return switch (orderType) {
            case 1 -> "ORDER BY create_time DESC";
            case 2 -> "ORDER BY like_count DESC";
            case 3 -> "ORDER BY view_count DESC";
            case 4 -> "ORDER BY update_time ASC";
            default -> "";
        };
    }

}
